package com.bsoft.gol.hcs.specialist.dao;

import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import com.bsoft.gol.hcs.specialist.entity.FollowUpRecordsEducation;
import org.atag.dao.ext.HibernateExtendDAO;

import java.util.Date;
import java.util.List;

/**
 * 随访关联健康宣教表(FollowUpRecordsEducation)表数据库访问层
 *
 * @author neoLin
 * @since 2022-07-15 16:10:14
 */
public abstract class FollowUpRecordsEducationDAO extends HibernateExtendDAO<FollowUpRecordsEducation> {

    @DAOMethod(sql =" from FollowUpRecordsEducation where recordId=:recordId" )
    public abstract List<FollowUpRecordsEducation> findQuestionByRecordId(@DAOParam("recordId")Long recordId);

    @DAOMethod(sql =" update FollowUpRecordsEducation set educationStatus=1,educationTime=:educationTime where recordId =:recordId and educationId =:educationId " )
    public abstract void updateEducationStatus(@DAOParam("recordId") Long recordId, @DAOParam("educationId") Long educationId, @DAOParam("educationTime") Date educationTime);

    @DAOMethod(sql = " select count(1) from FollowUpRecordsEducation where recordId =:recordId and educationStatus =0 ")
    public abstract Long getCountContentByRecordId(@DAOParam("recordId") Long recordId);

    @DAOMethod(sql =" delete from FollowUpRecordsEducation where id in (:formIds)" )
    public abstract void removeByEduFormIds(@DAOParam("formIds")List<String> formIds);

}


